//实例化编辑器
var options = {
	toolbars:  [['bold','italic','underline','justifyleft','justifycenter','justifyright','link','simpleupload','insertvideo','source']],
	imageUrlPrefix:'http://park.sanzhi.org.cn/',
	qulity:0.2,
	initialFrameWidth:'100%',
	initialFrameHeight:420,
	focus:false,
    elementPathEnabled:false,
    wordCount:false,

    catchRemoteImageEnable:false
	,pasteplain:true  //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
	//纯文本粘贴模式下的过滤规则
	,'filterTxtRules' : function(){
		function transP(node){
			node.tagName = 'p';
			node.setStyle();
		}
		return {
			//直接删除及其字节点内容
			'-' : 'script style object iframe embed input select',
			'p': {$:{}},
			'br':{$:{}},
			'div':{$:{}},
			'li':{$:{}},
			'caption':{$:{}},
			'th':{$:{}},
			'tr':{$:{}},
			'h1':{$:{}},'h2':{$:{}},'h3':{$:{}},'h4':{$:{}},'h5':{$:{}},'h6':{$:{}},
			'td':function(node){
				//没有内容的td直接删掉
				var txt = !!node.innerText();
				if(txt){
					node.parentNode.insertAfter(UE.uNode.createText(' &nbsp; &nbsp;'),node);
				}
				node.parentNode.removeChild(node,node.innerText())
			}
		}
	}()

};
options = {
	toolbars : [ ['bold' ] ]
};
console.log('ue loading2');
var ue = UE.getEditor('tseditor', options);
// ue.addListener("ready", function () {
ue.ready(function () {
	console.log('ue ready');
});
